<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.core.Array</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.core.Array");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791">tango.core.Array</a></h1>
                
<font color="black">The array module provides array manipulation routines in a manner that
 balances performance and flexibility.  Operations are provided for sorting,
 and for processing both sorted and unsorted arrays.</font><br><br>
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Authors:</b><br>
Sean Kelly<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L111">find</a></span>
<script>explorer.outline.addDecl('find');</script>( T )(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L130">find</a></span>
<script>explorer.outline.addDecl('find');</script>(Elem[] <span class="funcparam">buf</span>, Elem[] <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L261">rfind</a></span>
<script>explorer.outline.addDecl('rfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from (buf.length .. 0], returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L280">rfind</a></span>
<script>explorer.outline.addDecl('rfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem[] <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from (buf.length .. 0], returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L420">kfind</a></span>
<script>explorer.outline.addDecl('kfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<font color="black">This function uses the KMP algorithm and offers O&#40;M+N&#41; performance but
 must allocate a temporary buffer of size pat.sizeof to do so.  If it is
 available on the target system, alloca will be used for the allocation,
 otherwise a standard dynamic memory allocation will occur.<br><br> </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L444">kfind</a></span>
<script>explorer.outline.addDecl('kfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem[] <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<font color="black">This function uses the KMP algorithm and offers O&#40;M+N&#41; performance but
 must allocate a temporary buffer of size pat.sizeof to do so.  If it is
 available on the target system, alloca will be used for the allocation,
 otherwise a standard dynamic memory allocation will occur.<br><br> </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L602">krfind</a></span>
<script>explorer.outline.addDecl('krfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from (buf.length .. 0], returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<font color="black">This function uses the KMP algorithm and offers O&#40;M+N&#41; performance but
 must allocate a temporary buffer of size pat.sizeof to do so.  If it is
 available on the target system, alloca will be used for the allocation,
 otherwise a standard dynamic memory allocation will occur.<br><br> </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L626">krfind</a></span>
<script>explorer.outline.addDecl('krfind');</script>(Elem[] <span class="funcparam">buf</span>, Elem[] <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from (buf.length .. 0], returning
 the index of the first element matching pat, or buf.length if no match
 was found.  Comparisons will be performed using the supplied predicate
 or '==' if none is supplied.</font><br><br>
<font color="black">This function uses the KMP algorithm and offers O&#40;M+N&#41; performance but
 must allocate a temporary buffer of size pat.sizeof to do so.  If it is
 available on the target system, alloca will be used for the allocation,
 otherwise a standard dynamic memory allocation will occur.<br><br> </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L784">findIf</a></span>
<script>explorer.outline.addDecl('findIf');</script>(Elem[] <span class="funcparam">buf</span>, Pred1E <span class="funcparam">pred</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element where pred returns true.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element is a valid match and false if not.  This predicate
         may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L849">rfindIf</a></span>
<script>explorer.outline.addDecl('rfindIf');</script>(Elem[] <span class="funcparam">buf</span>, Pred1E <span class="funcparam">pred</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from (buf.length .. 0], returning
 the index of the first element where pred returns true.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element is a valid match and false if not.  This predicate
         may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L921">findAdj</a></span>
<script>explorer.outline.addDecl('findAdj');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 the index of the first element that compares equal to the next element
 in the sequence.  Comparisons will be performed using the supplied
 predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1002">contains</a></span>
<script>explorer.outline.addDecl('contains');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 true if an element matching pat is found.  Comparisons will be performed
 using the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
True if an element equivalent to pat is found, false if not.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1020">contains</a></span>
<script>explorer.outline.addDecl('contains');</script>(Elem[] <span class="funcparam">buf</span>, Elem[] <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 true if a sequence matching pat is found.  Comparisons will be performed
 using the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
True if an element equivalent to pat is found, false if not.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1104">mismatch</a></span>
<script>explorer.outline.addDecl('mismatch');</script>(Elem[] <span class="funcparam">bufA</span>, Elem[] <span class="funcparam">bufB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a parallel linear scan of bufA and bufB from [0 .. N)
 where N = min(bufA.length, bufB.length), returning the index of
 the first element in bufA which does not match the corresponding element
 in bufB or N if no mismatch occurs.  Comparisons will be performed using
 the supplied predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">bufA</span></td><td>The array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">bufB</span></td><td>The array to match against.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first mismatch or N if the first N elements of bufA
 and bufB match, where N = min(bufA.length, bufB.length).<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1192">count</a></span>
<script>explorer.outline.addDecl('count');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 a count of the number of elements matching pat.  Comparisons will be
 performed using the supplied predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to match.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements matching pat.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1268">countIf</a></span>
<script>explorer.outline.addDecl('countIf');</script>(Elem[] <span class="funcparam">buf</span>, Pred1E <span class="funcparam">pred</span> = Pred1E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), returning
 a count of the number of elements where pred returns true.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element is a valid match and false if not.  This predicate
         may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements where pred returns true.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1338">replace</a></span>
<script>explorer.outline.addDecl('replace');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Elem <span class="funcparam">val</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), replacing
 occurrences of pat with val.  Comparisons will be performed using the
 supplied predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to match.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">val</span></td><td>The value to substitute.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements replaced.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1418">replaceIf</a></span>
<script>explorer.outline.addDecl('replaceIf');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">val</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), replacing
 elements where pred returns true with val.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">val</span></td><td>The value to substitute.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element is a valid match and false if not.  This predicate
         may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements replaced.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1495">remove</a></span>
<script>explorer.outline.addDecl('remove');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), moving all
 elements matching pat to the end of the sequence.  The relative order of
 elements not matching pat will be preserved.  Comparisons will be
 performed using the supplied predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.  This parameter is not marked 'inout'
         to allow temporary slices to be modified.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on the
         result of this operation, even though it may be viewed as a
         side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to match against.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements that do not match pat.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1595">removeIf</a></span>
<script>explorer.outline.addDecl('removeIf');</script>(Elem[] <span class="funcparam">buf</span>, Pred1E <span class="funcparam">pred</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), moving all
 elements that satisfy pred to the end of the sequence.  The relative
 order of elements that do not satisfy pred will be preserved.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.  This parameter is not marked 'inout'
         to allow temporary slices to be modified.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on the
         result of this operation, even though it may be viewed as a
         side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element satisfies the condition and false if not.  This
         predicate may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements that do not satisfy pred.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1688">distinct</a></span>
<script>explorer.outline.addDecl('distinct');</script>(Elem[] <span class="funcparam">buf</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [0 .. buf.length), moving all
 but the first element of each consecutive group of duplicate elements to
 the end of the sequence.  The relative order of all remaining elements
 will be preserved.  Comparisons will be performed using the supplied
 predicate or '==' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to scan.  This parameter is not marked 'inout'
         to allow temporary slices to be modified.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on the
         result of this operation, even though it may be viewed as a
         side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         equal to e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of distinct sub-sequences in buf.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1788">shuffle</a></span>
<script>explorer.outline.addDecl('shuffle');</script>(Elem[] <span class="funcparam">buf</span>, Oper1A <span class="funcparam">oper</span> = Oper1A.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a linear scan of buf from [2 .. buf.length), exchanging
 each element with an element in the range [0 .. pos), where pos
 represents the current array position.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to shuffle.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">oper</span></td><td>The randomize operation, which should return a number in the
         range [0 .. N) for any supplied value N.  This routine
         may be any callable type.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1866">partition</a></span>
<script>explorer.outline.addDecl('partition');</script>(Elem[] <span class="funcparam">buf</span>, Pred1E <span class="funcparam">pred</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Partitions buf such that all elements that satisfy pred will be placed
 before the elements that do not satisfy pred.  The algorithm is not
 required to be stable.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to partition.  This parameter is not marked 'inout'
         to allow temporary slices to be sorted.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on
         the result of this operation, even though it may be viewed
         as a side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if the
         element satisfies the condition and false if not.  This
         predicate may be any callable type.</td></tr></table><br>
<b>Returns:</b><br>
The number of elements that satisfy pred.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L1977">select</a></span>
<script>explorer.outline.addDecl('select');</script>(Elem[] <span class="funcparam">buf</span>, Num <span class="funcparam">num</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Partitions buf with num - 1 as a pivot such that the first num elements
 will be less than or equal to the remaining elements in the array.
 Comparisons will be performed using the supplied predicate or '&lt;' if
 none is supplied.  The algorithm is not required to be stable.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to partition.  This parameter is not marked 'inout'
         to allow temporary slices to be sorted.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on
         the result of this operation, even though it may be viewed
         as a side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">num</span></td><td>The number of elements which are considered significant in
         this array, where num - 1 is the pivot around which partial
         sorting will occur.  For example, if num is buf.length / 2
         then select will effectively partition the array around its
         median value, with the elements in the first half of the array
         evaluating as less than or equal to the elements in the second
         half.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the pivot point, which will be the lesser of num - 1 and
  buf.length.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2091">sort</a></span>
<script>explorer.outline.addDecl('sort');</script>( Elem, Pred2E = IsLess!(Elem) )(Elem[] <span class="funcparam">buf</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Sorts buf using the supplied predicate or '&lt;' if none is supplied.  The
 algorithm is not required to be stable.  The current implementation is
 based on quicksort, but uses a three-way partitioning scheme to improve
 performance for ranges containing duplicate values &#40;Bentley and McIlroy,
 1993&#41;.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to sort.  This parameter is not marked 'inout' to
         allow temporary slices to be sorted.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on
         the result of this operation, even though it may be viewed
         as a side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2336">lbound</a></span>
<script>explorer.outline.addDecl('lbound');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a binary search of buf, returning the index of the first
 location where pat may be inserted without disrupting sort order.  If
 the sort order of pat precedes all elements in buf then 0 will be
 returned.  If the sort order of pat succeeds the largest element in buf
 then buf.length will be returned.  Comparisons will be performed using
 the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The sorted array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>size_t <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2420">ubound</a></span>
<script>explorer.outline.addDecl('ubound');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a binary search of buf, returning the index of the first
 location beyond where pat may be inserted without disrupting sort order.
 If the sort order of pat precedes all elements in buf then 0 will be
 returned.  If the sort order of pat succeeds the largest element in buf
 then buf.length will be returned.  Comparisons will be performed using
 the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The sorted array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
The index of the first match or buf.length if no match was found.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2501">bsearch</a></span>
<script>explorer.outline.addDecl('bsearch');</script>(Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">pat</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a binary search of buf, returning true if an element equivalent
 to pat is found.  Comparisons will be performed using the supplied
 predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The sorted array to search.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pat</span></td><td>The pattern to search for.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
True if an element equivalent to pat is found, false if not.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2578">includes</a></span>
<script>explorer.outline.addDecl('includes');</script>(Elem[] <span class="funcparam">setA</span>, Elem[] <span class="funcparam">setB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs a parallel linear scan of setA and setB from [0 .. N)
 where N = min(setA.length, setB.length), returning true if setA
 includes all elements in setB and false if not.  Both setA and setB are
 required to be sorted, and duplicates in setB require an equal number of
 duplicates in setA.  Comparisons will be performed using the supplied
 predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setA</span></td><td>The sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setB</span></td><td>The sorted array to match against.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
true if setA includes all elements in setB, false if not.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Elem[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2667">unionOf</a></span>
<script>explorer.outline.addDecl('unionOf');</script>(Elem[] <span class="funcparam">setA</span>, Elem[] <span class="funcparam">setB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Computes the union of setA and setB as a set operation and returns the
 retult in a new sorted array.  Both setA and setB are required to be
 sorted.  If either setA or setB contain duplicates, the result will
 contain the larger number of duplicates from setA and setB.  When an
 overlap occurs, entries will be copied from setA.  Comparisons will be
 performed using the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setA</span></td><td>The first sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setB</span></td><td>The second sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
A new array containing the union of setA and setB.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Elem[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2753">intersectionOf</a></span>
<script>explorer.outline.addDecl('intersectionOf');</script>(Elem[] <span class="funcparam">setA</span>, Elem[] <span class="funcparam">setB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Computes the intersection of setA and setB as a set operation and
 returns the retult in a new sorted array.  Both setA and setB are
 required to be sorted.  If either setA or setB contain duplicates, the
 result will contain the smaller number of duplicates from setA and setB.
 All entries will be copied from setA.  Comparisons will be performed
 using the supplied predicate or '&lt;' if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setA</span></td><td>The first sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setB</span></td><td>The second sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
A new array containing the intersection of setA and setB.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Elem[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2835">missingFrom</a></span>
<script>explorer.outline.addDecl('missingFrom');</script>(Elem[] <span class="funcparam">setA</span>, Elem[] <span class="funcparam">setB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns a new array containing all elements in setA which are not
 present in setB.  Both setA and setB are required to be sorted.
 Comparisons will be performed using the supplied predicate or '&lt;'
 if none is supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setA</span></td><td>The first sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setB</span></td><td>The second sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
A new array containing the elements in setA that are not in setB.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Elem[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L2924">differenceOf</a></span>
<script>explorer.outline.addDecl('differenceOf');</script>(Elem[] <span class="funcparam">setA</span>, Elem[] <span class="funcparam">setB</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns a new array containing all elements in setA which are not
 present in setB and the elements in setB which are not present in
 setA.  Both setA and setB are required to be sorted.  Comparisons
 will be performed using the supplied predicate or '&lt;' if none is
 supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setA</span></td><td>The first sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">setB</span></td><td>The second sorted array to evaluate.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br>
<b>Returns:</b><br>
A new array containing the elements in setA that are not in setB
  and the elements in setB that are not in setA.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L3010">makeHeap</a></span>
<script>explorer.outline.addDecl('makeHeap');</script>(Elem[] <span class="funcparam">buf</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Converts buf to a heap using the supplied predicate or '&lt;' if none is
 supplied.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The array to convert.  This parameter is not marked 'inout' to
         allow temporary slices to be sorted.  As buf is not resized in
         any way, omitting the 'inout' qualifier has no effect on the
         result of this operation, even though it may be viewed as a
         side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L3139">pushHeap</a></span>
<script>explorer.outline.addDecl('pushHeap');</script>(inout Elem[] <span class="funcparam">buf</span>, Elem <span class="funcparam">val</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Adds val to buf by appending it and adjusting it up the heap.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The heap to modify.  This parameter is marked 'inout' because
         buf.length will be altered.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">val</span></td><td>The element to push onto buf.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L3260">popHeap</a></span>
<script>explorer.outline.addDecl('popHeap');</script>(inout Elem[] <span class="funcparam">buf</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Removes the top element from buf by swapping it with the bottom element,
 adjusting it down the heap, and reducing the length of buf by one.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The heap to modify.  This parameter is marked 'inout' because
         buf.length will be altered.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/Array.d?rev=3791#L3385">sortHeap</a></span>
<script>explorer.outline.addDecl('sortHeap');</script>(Elem[] <span class="funcparam">buf</span>, Pred2E <span class="funcparam">pred</span> = Pred2E.init);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Sorts buf as a heap using the supplied predicate or '&lt;' if none is
 supplied.  Calling makeHeap and sortHeap on an array in succession
 has the effect of sorting the array using the heapsort algorithm.</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">buf</span></td><td>The heap to sort.  This parameter is not marked 'inout' to
         allow temporary slices to be sorted.  As buf is not resized
         in any way, omitting the 'inout' qualifier has no effect on
         the result of this operation, even though it may be viewed
         as a side-effect.</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">pred</span></td><td>The evaluation predicate, which should return true if e1 is
         less than e2 and false if not.  This predicate may be any
         callable type.</td></tr></table><br></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (C) 2005-2006 Sean Kelly.  All rights reserved. :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:32 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>